																														
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
	    <meta charset="utf-8">
	    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <#include "/common/meta.ftl"/>
	    <#include "/common/form.ftl"/>
		<script>
		$(function(){
			
			$("#form").validate({
					rules: {
						
					},
					errorElement: "div",
					errorPlacement: function(error, element) {
						error.appendTo($(element).parent());
						$(element).parent().addClass("has-error");
						$(error).addClass("help-block alert-danger");
					},
					success: function(label) {
						$(label).parent().removeClass("has-error");
						$(label).remove();
					}
				})
			});
			function save(){
				if($("#form").valid()){
					$("#form").submit();
				}
			}
			
			function reportedSexChange() {
				$("#reportedSex").val($("#reportedRtype option:selected").val());
		    }
		    function disSexChange() {
				$("#disSex").val($("#disRtype option:selected").val());
		    }
		    //种类选择
		    function changeKind(value) {
		    	$("#kindId").val(value);
		    }
		    //级别选择
		    function changePost(value) {
		   	 $("#reportedUnitLevel").val(value);
		    }
		    
		     //转储赋值
		     function changeDump(value){
		     	var mxcode = $("#region option:selected").val();
		     	var discloseId = $("#discloseId").val();
	     		$.post('./changeDump', {mxcode: mxcode,discloseId:discloseId}, 
	     		
	     			function(data) {
						if(data.success){
							layer.msg('转储成功!',{time:500},function(){
								var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
								parent.layer.close(index);
							});
						}
					},'json');
		     }
		     
		      //导出word
		     function exportWord(){
		     	
		    	 var discloseId = $("#discloseId").val();
		     	 layer.confirm('您确定要导出word录吗？',{
					btn: ['确定','取消'] //按钮
					}, function(index){
						layer.close(index);
		     	 		location.href = "./exportWord?discloseId="+discloseId;
		     	 	});
		     }
		     
		     function showReplayWin(){ 
		      var discloseId = $("#discloseId").val();
			    layer.open({
	                id: 'fk-form',
	                type: 2,
	                title: '举报信息回复',
	                btn: ['确定','关闭'],
	                yes: function (index) {
	                    var frameId=document.getElementById('fk-form').getElementsByTagName("iframe")[0].id;
	                    console.log($("#"+frameId));
	                    frames[frameId].document.forms["form"].submit();
	                    // $('#'+frameId)[0].contentWindow.mySubmit();
	                    layer.close(index);
	                    location.reload();
	                },
	                maxmin: false,
	                area: ['800px', '425px'],
	                content: '${_b}/disclose/reportResponseForm?discloseId='+discloseId
	            });
		    }
		    
		</script>
<style>
	fieldset > legend {
	    border-bottom: 0 none;
	    font-size: 14px;
	    font-weight: bolder;
	    margin: 0 0 0 -5px;
	    padding: 0 5px;
	    width: auto;
	}
	fieldset {
	    border: 1px solid #e5e5e5;
	    margin-bottom: 10px;
	    padding: 10px 10px 0px;
	}
</style>
	</head>
	<body style="padding:5px;">
		<div class="panel panel-primary">
			<div class="panel-heading" style="">
				<strong>
					<i class="icon-pencil"></i> 查看被举报单位信息
				</strong>
			</div>
			<div class="panel-body" style="padding:5px;padding-top:15px;">
			<form id="form" class="form-horizontal" role="form" method='post' action="./discloseSave">
			<input type="hidden" id="discloseId" name="discloseId" value="${ discloseId }"/>
			<input type='hidden'  name="reportedSex"  id='reportedSex' value='${ formData.reportedSex!'' }' class='form-control' />
			<input type='hidden'  name="disSex"  id='disSex' value='${ formData.disSex!'' }' class='form-control' />	
			<input type='hidden'  name="kindId"  id='kindId' value='${ formData.kindId!'' }' class='form-control' />	
			<input type='hidden'  name="discloseType"  id='discloseType' value='${ formData.discloseType!'' }' class='form-control' />
			<fieldset>
				<legend><i class="icon icon-file-text-o"></i> 举报人信息</legend>
					<div class="">
							<table class="table table-bordered table-condensed">
								<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >举报人姓名</th>
						    		<td >${ formData.disName!'' }</td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >身份证号</th>
						    		<td >${ formData.identityCard!'' }</td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >举报人性别</th>
						    		<td >
						    		 <#assign disSex = 0>
		                                <#if formData.disSex?exists>
				             				<#assign disSex = (formData.disSex!'')/>
				             			</#if>
			                            <#if disSex == 0>女</#if>
			                            <#if disSex == 1>男</#if>
			                        
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在单位</th>
						    		<td colspan="3">${ formData.disUnit!'' }</td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >职务</th>
						    		<td >${ formData.disPost!'' }</td>
						    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在地区</th>
						    		<td colspan="3">${ formData.disRegion!'' }</td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >邮政编码</th>
						    		<td >${ formData.zipCode!'' }</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >联系电话</th>
						    		<td >${ formData.phone!'' }</td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >手机</th>
						    		<td >${formData.telephone!'' }</td>
						    		<th width="100" style="text-align:center;background-color:#eee;" >Email</th>
						    		<td >${ formData.email!'' }</td>
						    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >联系地址</th>
						    		<td colspan="5">${ formData.address!'' }</td>
						  		</tr>
							</table>
						</div>	
				</fieldset>
				<fieldset>
				<legend><i class="icon icon-file-text-o"></i> 被举报单位信息</legend>
					<div class="">
							<table border="0" style="width=100%">
								<tr style="">
						    		<th width="100px" style="text-align:right;" >举报编号:</th>
						    		<td width="78%">${ formData.reportCode!'' }</td>
						    		<th  width="100px">举报日期:</th>
						    		<td width="120px">${ formData.disDate!'' }</td>
						    		<!-- disPost-->
						  		</tr>
						  	</table>
							<table class="table table-bordered table-condensed">
								
						  		<tr style="">
						  			<th width="100" style="text-align:center;background-color:#eee;" >举报信息来源</th>
						    		<td ><input type='text'  name="mxname"  id='mxname'readOnly value='${ formData.mxname!'' }' class='form-control' /></td>
						  		
						    		<th width="100" style="text-align:center;background-color:#eee;" >信息种类</th>
						    		<td colspan="3">
						    			${ formData.kindName!'' }
						    		</td>
						    								    		
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >单位名称</th>
						    		<td >${ formData.reportedName!'' }</td>
									<th  style="text-align:center;background-color:#eee;" >单位级别</th>
						    		<td colspan="3">
						    			${ formData.levelName!'' }
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >所在地区</th>
						    		<td colspan="5">${ formData.reportedRegion!'' }</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >主要问题</th>
						    		<td colspan="5">
						    		
						    		<textarea id="mainContent" name="mainContent" readOnly type="text/plain" style="width:100%;height:200px;">${formData.mainContent!''}</textarea>
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >数据转储</th>
						    		<td colspan="5">
						    		<table style="width:100%;margin:0px; border:0px; cellspacing:0px;cellpadding:0px;">
						    			<tr>
						    				<td style="border:0px;border-top:0px;">
							    				<select id="region" name="region" class="form-control" 
								    				style="width:100%;height:30px;"" > 
						                             <#assign region = '0311'>
						                             
						                             <#if reportRegionList?exists>
						                             	<#assign region = (formData.mxcode!'')/>
						                             	
							                            <#list reportRegionList as x>
									   						<option value="${x.regionCode!''}" <#if x.regionCode == region>selected</#if> >${x.regionName!''}</option>
									   					</#list>
								   					 </#if>
						                        </select> 
						    				</td>
						    				<td width="380"style="border:0px;border-top:0px;">
						    					<button type="button" onclick="changeDump()">保存转储</button> 
						    					<span  style = "color:red;margin-right:30px;"> 注：点击按钮进行数据转储</span>
						    					<button type="button"style:"margin-left:30px;" onclick="exportWord()">导出word</button>
						    				</td>
						    			</tr>
						    			</table>
						    		</td>
						  		</tr>
							</table>
						</div>	
				</fieldset>
				<!-- 
				<#if formData.replyDate !=''>
				<fieldset>
				<legend><i class="icon icon-file-text-o"></i> 举报人信息回复</legend>
					<div class="">
							<table  class="table table-bordered table-condensed">
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >回复人</th>
						    		<td >
						    			<input type='text'  name="replyUname" readOnly id='replyUname' value='${ formData.replyUname!'' }' class='form-control' />
						    		</td>
						    		<th width="140" style="text-align:center;background-color:#eee;" >回复时间</th>
						    		<td>	
						    			<input type='text'  name="replyDate" readOnly id='replyDate' value='${ formData.replyDate!'' }' class='form-control' />
						    		</td>
						  		</tr>
						  		<tr style="">
						    		<th width="100" style="text-align:center;background-color:#eee;" >举报回复内容</th>
						    		<td colspan="3">
						    			<textarea id="replyContent"  name="replyContent" type="text/plain" style="width:100%;height:200px;">${ formData.replyContent!'' }</textarea>
						    		</td>
						  		</tr>
							</table>
						</div>	
				</fieldset>
				</#if>-->
				<div style="margin-top:5px;padding:5px;text-align:center;">
					<!--<button class="btn" type="button" onclick="showReplayWin()"><i class="icon icon-reply"></i>回复</button>-->
					<button class="btn" type="button" onclick="history.go(-1);"><i class="icon icon-close"></i> 关闭</button>
				</div>
			</form>
		  	</div>
		</div>
	</body>
</html>